// instanceof 判断构造函数的prototype属性是否存在于实例对象的原型链上
// 注意instanceof 只能判断引用数据类型

function myInstanceOf(left, right) {
    if (typeof left !== 'object' || left === null) return false;

    let proto = Object.getPrototypeOf(left);

    while (true) {
        if (proto === null) return false;
        if (proto === right) return true;
        proto = proto.__proto__;
    };
};


const obj = {
    name: 'Ka',
    age: 18,
};


console.log(obj instanceof Object);

